<template>
  <div>
    <Dog2 v-for="(item,index) in list" :key="index" :dogImgUrl='item.dogImgUrl' :dogName='item.dogName'  @haha='xiugou'/>
    <p>您喜欢的狗狗如下：</p>
    <ul>
      <li v-for="(item,index) in arr" :key="index">{{item}}</li>
    </ul>
  </div>
</template>

<script>
import Dog2 from './components/Dog2.vue'
export default {
  components:{
    Dog2
  },
data(){
  return {
    list:[
    {
        dogImgUrl: "https://img1.baidu.com/it/u=2961286727,565102416&fm=253&fmt=auto&app=138&f=JPEG?w=650&h=488",
        dogName: "大黄",
    },
    {
        dogImgUrl:"https://img0.baidu.com/it/u=1868387349,3744581611&fm=253&fmt=auto&app=138&f=JPEG?w=510&h=382",
        dogName: "小白",
    },
    {
        dogImgUrl:"https://img2.baidu.com/it/u=59953004,2444444714&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=365",
        dogName: "迪迦",
    },
    {
        dogImgUrl:"https://img1.baidu.com/it/u=1795611050,2013221134&fm=253&fmt=auto&app=120&f=JPEG?w=1422&h=800",
        dogName: "盖亚",
    },
    {
        dogImgUrl:"https://img0.baidu.com/it/u=3124897733,1081819904&fm=253&fmt=auto&app=138&f=JPEG?w=750&h=500",
        dogName: "戴拿",
    },
    {
        dogImgUrl:"https://img0.baidu.com/it/u=2264105055,1521933415&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=889",
        dogName: "屠龙刀",
    },
],
arr:[]
  }
},
methods:{
  xiugou(dog){
    this.arr.push(dog)
    console.log(dog);
  }
}
}
</script>

<style>

</style>